﻿@{
    Layout = null;
}
@model Inspinia_MVC5.Models.Admin
<!DOCTYPE html>
<html>
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>INSPINIA | Login</title>

    <link href="~/Content/bootstrap.min.css" rel="stylesheet">
    <link href="~/Fonts/font-awesome/css/font-awesome.css" rel="stylesheet">

    <link href="~/Content/animate.css" rel="stylesheet">
    <link href="~/Content/style.css" rel="stylesheet">
    <script src="~/Scripts/jquery-3.1.1.min.js"></script>
    <script src="~/Content/softkey-master/softkeys-0.0.1.js"></script>

    <link href="~/Content/softkey-master/softkeys-0.0.1.css" rel="stylesheet" />
    <script type="text/javascript">
        $(function () {
            $(".softkeys").hide();

            //判断用户的登录身份
            $('#shenfen').change(function () {
                if ($(this).val() == "1") {
                    $("#AdminUserName").attr("placeholder", "用户名");
                } else if ($(this).val() == "2") {
                    $("#AdminUserName").attr("placeholder", "身份证编号/教职工编号");
                } else if ($(this).val() == "3") {
                    $("#AdminUserName").attr("placeholder", "身份证编号/学号");
                }
            })

            //点击刷新验证码
            $("#valiCode").click(function () {
                let date = new Date().getTime();
                $("#valiCode").attr("src", "GetValidateCode?=" + date);
            });

            //生成虚拟键盘
            $('.softkeys').softkeys({
                target: $('.softkeys').data('target'),
                layout: [
                    [
                        ['1', '!'],
                        ['2'],
                        ['3', '#'],
                        ['4', '$'],
                        ['5', '%'],
                        ['6', '^'],
                        ['7', '&'],
                        ['8', '*'],
                        ['9', '('],
                        ['0', ')'],
                        'delete'
                    ]
                ]
            });

            //虚拟键盘的显示隐藏
            $("#ValidateCodes").click(function () {
                $(".softkeys").toggle();
            });



        });
    </script>
    <style>

        body {
            background-image: url('../../Content/patterns/bg2.jpg');
            /*background-image: url('../../Content/patterns/bg.jpg');*/
        }

        .validation-summary-errors ul {
            list-style: none;
        }

        .softkeys {
            width: 308.5px;
            height: 100px;
            background-color: white;
            position: absolute;
            margin-top: -5%;
            margin-left: -8px;
            z-index: 9999;
            -webkit-transition: .5s ease-in-out; /* css的transition允许css的属性值在一定的时间内从一个状态平滑的过渡到另一个状态 */
            -moz-transition: .5s ease-in-out; /*这里为了兼容其他浏览器*/
            -o-transition: .5s ease-in-out;
            border-radius: 5px;
            padding-top: 15px;
        }
    </style>
</head>

<body class="gray-bg">

    @using (Html.BeginForm("Login", "Pages"))
    {
        <div class="middle-box text-center loginscreen  animated fadeInDown">
            <div>
                <div>

                    <h1 class="logo-name">book</h1>

                </div>
                <h3>欢迎使用BOOK图书管理系统</h3>
                <p>欢迎登录使用&nbsp;&nbsp;|&nbsp;&nbsp;没有账号？@Html.ActionLink("注册一个", "Register")</p>
                <div class="form-group">
                    <select class="form-control" id="shenfen" name="shenfen">
                        <option value="0">请选择您的身份</option>
                        <option value="1">管理员</option>
                        <option value="2">教师</option>
                        <option value="3">学生</option>
                    </select>
                </div>
                <div id="admin">
                    <div class="form-group">
                        <input type="text" class="form-control" required="" name="AdminUserName" id="AdminUserName" placeholder="身份证编号">
                    </div>
                    <div class="form-group">
                        <input type="password" class="form-control" placeholder="密码" required="" name="AdminPassword" id="AdminPassword">
                    </div>
                    <div class="form-group">
                        <input type="text" class="form-control" placeholder="验证码" required="" name="ValidateCodes" id="ValidateCodes">
                    </div>
                    <div class="form-group">
                        <img id="valiCode" style="cursor: pointer;" src="~/Pages/GetValidateCode" alt="验证码" />
                    </div>
                    <div class="form-group">
                        <div class="softkeys" data-target="input[name='ValidateCodes']"></div>
                    </div>
                </div>

                <button type="submit" class="btn btn-primary block full-width m-b">登录</button>
                <span style="color:red">@Html.ValidationSummary(true)</span>
                @Html.ActionLink("忘记密码？", "Login_2", "Pages")
            </div>
        </div>
    }
</body>

</html>


